<?php
namespace WinZ\DataMinerBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Server
 *
 * @author Winz
 */
/**
 * @ORM\Entity(repositoryClass="WinZ\DataMinerBundle\Repository\ServerRepository")
 * @ORM\Table(name="servers")
 */
class Server {
         /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
    
    
     /**
     * @ORM\Column(type="text")
     */
    protected $name;
    
     /**
     * @ORM\OneToMany(targetEntity="Character", mappedBy="server")
     */
    protected $characters;
    
    public function __construct()
    {
        
        $this->characters = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Server
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add characters
     *
     * @param \WinZ\DataMinerBundle\Entity\Character $characters
     * @return Server
     */
    public function addCharacter(\WinZ\DataMinerBundle\Entity\Character $characters)
    {
        $this->characters[] = $characters;
    
        return $this;
    }

    /**
     * Remove characters
     *
     * @param \WinZ\DataMinerBundle\Entity\Character $characters
     */
    public function removeCharacter(\WinZ\DataMinerBundle\Entity\Character $characters)
    {
        $this->characters->removeElement($characters);
    }

    /**
     * Get characters
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCharacters()
    {
        return $this->characters;
    }
}